package zunyi07;

public class StaffTest {
    public static void main(String[] args) {
        //还是建议使用有参构造器方便初始化值可读性高
        Staff s1 = new Teacher();
        Staff s2 = new Programmer();
        Staff s3 = new Network();
        s2.setId(1);
        s2.setName("老王");
        System.out.print("id为"+s2.getId()+"的"+s2.getName());
        s2.work();
        s1.setId(2);
        s1.setName("王老师");
        System.out.print("id为"+s1.getId()+"的"+s1.getName());
        s1.work();
        s3.setId(3);
        s3.setName("小王");
        System.out.print("id为"+s3.getId()+"的"+s3.getName());
        s3.work();

    }
}
